<!DOCTYPE html>
<html lang="es">
<head>
	<%@ include file="/jsp/fragments/include.jsp" %>
	<title>Abel Personnel - Administration - Search Results</title>
	<meta charset="utf-8"/>
	<meta name="description" CONTENT="Abel Personnel application"/>
	<meta name="keywords" CONTENT="Abel, Abel Personnel, Personnel, Personnel Application, Temporary Job, Temporary, Consulting, Job, Harrisburg"/>
	
	<link type="text/css" href="jsp/lib/css/main.css" rel="stylesheet"/>


	<!--[if lt IE 8]>
		<link rel="stylesheet" type="text/css" media="all" href="jsp/lib/css/ie6.css"/>
	<![endif]-->
	
	<!--[if IE]>
		<link rel="stylesheet" type="text/css" media="all" href="jsp/lib/css/ie.css"/>
	<![endif]-->
  
  <!-- BRAND CSS -->
	<link type="text/css" href="jsp/brand/abel/brand.css" rel="stylesheet"/>
	
	<script src="lib/js/jquery-1.4.2.js"></script>
	<script src="lib/js/personnelApp.js"></script>
	<script LANGUAGE="JavaScript">
	<!-- Begin

		function applicationSelect() 
		{
			if (document.forms[0].selectAll.checked)
			{
				checkAll(document.forms[0].application);
			}
			else
			{
				uncheckAll(document.forms[0].application);
			}
		}
	
		function checkAll(field)
		{
			for (i = 0; i < field.length; i++)
				field[i].checked = true ;
		}
	
		function uncheckAll(field)
		{
			for (i = 0; i < field.length; i++)
				field[i].checked = false ;
		}
	//  End -->
	</script>

</head>
<body class="search" id="index">
	
	<!-- HEADER -->
	<div id="header" class="body">
		<header class="body" id="banner">
			<h1><a href="#">Abel Personnel</a></h1>
			<div class="description"> 
	      Personal Touch -- Professional Quality
	      <br/> 
	      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"We stake our reputation on the people who work for you"
	    </div>
		</header>
	</div>
	
	<!-- CONTENT -->
	<div id="section" class="body">
		<section class="body" id="content">
			
			<div class="user">${searchView.salutation} &nbsp;&nbsp; <span class="userLinks">[<a href="admindashboard.xhtm">Admin Dashboard</a>] &nbsp; <a href="logout.xhtm">Sign Out</a>]</span></div>
			
			<!-- FEATURED AREA / BREADCRUMBS / PROGRESS -->
			<h2>Administration: <span class="nobold">Search Results</span></h2>
			<p> 	
				<spring:hasBindErrors name="educationInfoView">
					<div class="error">
						<span class="errorHeading">Please correct the following error(s).</span>
		             	<c:forEach items="${errors.allErrors}" var="error">  
		                	<span class="errorDetail"><spring:message code="${error.code}" text="${error.defaultMessage}"/></span>  
		             	</c:forEach>  
		         	</div> 
		     	</spring:hasBindErrors>
			</p>
			<form:form method="post" commandName="searchView" action="submitToResumate.xhtm">
				<div class="fieldset">
					<h3>Filter by:</h3>
					<ul>
						<c:if test="${searchView.lastName != null && searchView.lastName != ''}">
							<li><strong>Last Name:</strong> ${searchView.lastName}</li>
						</c:if>
						<c:if test="${searchView.ssn != null && searchView.ssn != ''}">
							<li><strong>SSN:</strong> ${searchView.ssn}</li>
						</c:if>
						<c:if test="${searchView.dateSubmittedBegin != null && searchView.dateSubmittedBegin != ''}">
							<li><strong>Start Date:</strong> ${searchView.dateSubmittedBegin}</li>
						</c:if>
						<c:if test="${searchView.dateSubmittedEnd != null && searchView.dateSubmittedEnd != ''}">
							<li><strong>End Date:</strong> ${searchView.dateSubmittedEnd}</li>
						</c:if>
						<c:if test="${searchView.dateLastSevenDays != null && searchView.dateLastSevenDays != ''}">
							<li><strong>Last 7 days</strong></li>
						</c:if>
					</ul>
					<c:choose>
						<c:when test="${searchView.hasApplications}">
							<c:if test="${searchView.hasApplications}">
								<table class="searchResults">
									<thead>
										<tr>
											<th class="cell0">
												<form:checkbox path="selectAll" value="Y" onclick="javascript:applicationSelect()"/>
											</th>
											<th class="cell1">Name</th>
											<th class="cell2">SSN</th>
											<th class="cell3">Date Submitted</th>
											<th class="cell4">Desired Position 1</th>
											<th class="cell5">Desired Position 2</th>
											<th class="cell6">Actions</th>
										</tr>
									</thead>
									<tbody>
							</c:if>
							<c:forEach items="${searchView.applications}" var="person" >
									<tr class="odd">
										<td class="cell1">
											<form:checkbox path="application" value="${person.application.applicationId}" cssClass="checkAll"/>
										</td>
										<td class="cell1">
											${person.application.personProfile.personalInformation.lastName},
											&nbsp;${person.application.personProfile.personalInformation.firstName}
										</td>
										<td class="cell2">
											${person.application.personProfile.personalInformation.ssn}
										</td>
										<td class="cell3">
											${person.application.personProfile.personalInformation.createDate}
										</td>
										<td class="cell4">
											${person.application.personProfile.desiredPosition.position1stDesired}
										</td>
										<td class="cell5">
											${person.application.personProfile.desiredPosition.position2ndDesired}
										</td>
										<td class="cell6">
											[<a href="adminApplication.xhtm?id=${person.userId}&appid=${person.application.applicationId}" title="View Details / Edit" class="searchEdit">View</a>]
											<br/>
											[<a href="javascript:void(0)" title="Print PDF" class="searchPdf" onclick="window.open('printPDF.xhtm?id=${person.userId}&appid=${person.application.applicationId}')">PDF</a>]
										</td>
									</tr>
							</c:forEach>
							<c:if test="${searchView.hasApplications}">
									</tbody>
								</table>
							</c:if>
						</c:when>	
					<c:otherwise>
						<p>There are no records found for the above search criteria!</p>
						<div class="formFooter">
							<input type="submit" name="search" value="Return to Search" class="button"/>
						</div>			
					</c:otherwise>
				</c:choose>
			</div>
			<div class="formFooter">
				<c:if test="${searchView.hasApplications}">
					<input type="submit" name="exportToResumate" value="Export to Resumate" class="button"/> &nbsp;
					<input type="submit" name="search" value="Return to Search" class="button"/>
				</c:if>
			</div>
			</form:form>
		</section>
	</div>

	<!-- FOOTER -->
	<div id="footer">
		<footer id="contentinfo">
			<p class="copyright">&copy; <a href="http://www.abelpersonnel.com">Abel Personnel, Inc.</a>  All rights reserved</p>
		</footer>
	</div>

</body>
</html>